/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "stdafx.h"
#include "S_Object.h"

#include "S_键值序列容器.h"


static S_键值序列容器<uint32, S_Object*> g_物体容器;
static S_键值序列容器<uint32, S_物理体*> g_物理体容器;

C_Key分配器 S_Object::m_ID生成器;

S_Object::S_Object(uint32 key) {
	m_ID = key;
	m_globalID = m_ID生成器.f_Gen();
}
S_Object::~S_Object() {
	m_ID生成器.f_Move(m_globalID);
}


S_物理体::S_物理体(uint32 key) : S_Object(key) {
	//g_物理体容器.f_add(this, key);
	m_密度 = 0.7;
	m_重量 = 1.0;

	m_绑定物体 = nullptr;
	m_Data = nullptr;
	m_Type = E_物理体类型::E_物理体_空;
	m_物理引擎枚举 = E_物理引擎::E_物理引擎_Mujoco;
}

S_物理体::~S_物理体() {
	//g_物理体容器.f_remove(m_ID);
}

S_物理体* S_物理体::f_get(uint32 key) {
	/*if(g_物理体容器.f_is存在(key))
		return g_物理体容器[key];
	else return 0;*/
	return 0;
}

void S_物理体::f_set绑定物体矩阵(const Mat44f& mat) {

}

E_物体类型 f_ob_以名称取类型(std::wstring name) {
	E_物体类型 类型 = E_物体类型::t_空;



	return 类型;
}

E_物体类型 f_ob_以名称索引取类型(uint32 index) {
	switch (index) {
	
	case 0: return E_物体类型::t_网格;
	case 1: return E_物体类型::t_平行光;
	case 2: return E_物体类型::t_点光源;
	case 3: return E_物体类型::t_区域光;
	case 4: return E_物体类型::t_聚光灯;
	case 5: return E_物体类型::t_摄像机;
	case 6: return E_物体类型::t_虚拟体;

	case 7: return E_物体类型::t_多边形;
	default:
		break;
	}
	return E_物体类型();
}
